package com.kyzh.core.dialog

import android.content.Context
import android.widget.TextView
import com.kyzh.core.R
import com.kyzh.core.utils.TextsUtils
import com.lxj.xpopup.core.CenterPopupView


class TipsCenterPopupWindow(context: Context, val title: String, val message: String) : CenterPopupView(context) {
    private val mTvTitle by lazy { findViewById<TextView>(R.id.tvTitle) }
    private val mTvContent by lazy { findViewById<TextView>(R.id.tvContent) }
    private val mTvContrim by lazy { findViewById<TextView>(R.id.tvContrim) }


    override fun getImplLayoutId() = R.layout.dialog_popup_tips

    override fun onCreate() {
        super.onCreate()

        mTvTitle.text = title

        val htmlText = TextsUtils.unicodeToUtf8(message)
        mTvContent.text = htmlText
        mTvContrim.setOnClickListener {
            this.dialog.dismiss()
        }
    }


}
